import request from '@/utils/request'
import qs from 'qs'
export default{
    getDepartmentListPage(page,limit,keyword,keyword2,keyword3) {
    return request({
      url: `/department/pageDepartmentQuery?page=${page}&limit=${limit}&keyword=${keyword}&keyword2=${keyword2}&keyword3=${keyword3}`, // 分页查询
      method: 'get'
    })
  },
  delDepartmentById(id) {
    return request({
      url: `/department/deleteDepartment`, // 根据id删除
      method: 'post',
      data: {
        'id':id
      },
    })
  },
  delDeparByIds(ids){
    return request({
      url: `/department/deleteDepartmentByIds`, // 根据id删除
      method: 'post',
      data: ids,
      paramsSerializer: ids => qs.stringify(ids)
    })
  },
  addDepartment(addForm){
    return request({
      url: `/department/addDepartment`, // 添加的api
      method: 'post',
      data: addForm
    })
  },
  updateDepartment(updateForm){
    return request({
      url: `/department/updateDepartment`, // 根据id修改
      method: 'post',
      data: updateForm
    })
  },
  //导出excel
  exportDepartExcel(){
    return request({
      url: `/department/exportExcel`, // 导出excel
      method: 'get',
    })
  },
  importDepartExcel(){
    return request({
      url: `/department/importExcel`, // 导出excel
      method: 'post',
    })
  }
}
